package com.huangsm.book.designmodel.collection;


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 优化集合访问代码
 * @author huang
 * @PACKAGE_NAME com.huangsm.book.designmodel.collection
 * @PROJECT_NAME concurrence
 * @date 2019/2/18
 */
public class BetterCollection {

    public static void main(String[] args) {
                String [] strs={"north65","west20","east30","north64","west10","east20"};
        List<String> collection = Arrays.asList(strs);
        int count=0;
        //将循环中重复调用的collection.size()提出来
        int size = collection.size();
        for (int i=0; i <size; i++) {
        }
    }
}
